<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Update8 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->integer('image_tag_id')->nullable()->comment('角标id');
            $table->boolean('is_presell')->default(0)->index()->comment('是否预售');  // 是否预售
            $table->timestamp('presell_date')->nullable()->comment('预售日期');  //   // 
        });

        Schema::table('boxes', function (Blueprint $table) {
            $table->integer('image_tag_id')->nullable()->comment('角标id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn('image_tag_id');
            $table->dropColumn('is_presell');
            $table->dropColumn('presell_date');
        });

        Schema::table('boxes', function (Blueprint $table) {
            $table->dropColumn('image_tag_id');
        });
    }
}
